package com.xmtlxx.oms.mapper;

import com.xmtlxx.oms.domain.Rule;
import com.xmtlxx.oms.domain.bo.RuleBo;
import com.xmtlxx.oms.domain.vo.RuleVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 规则Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-12
 */
public interface RuleMapper extends BaseMapperPlus<RuleMapper, Rule, RuleVo> {
    /**
     * 根据条件分页查询规则
     *
     * @param rule 规则
     * @return Page Rule
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "r.create_by"),
//        @DataColumn(key = "deptName", value = "r.dept_id"),
//        @DataColumn(key = "userName", value = "r.create_by")
//    })
    Page<RuleVo> selectPageRuleList(@Param("page") Page<Rule> page,@Param("rule") RuleBo rule);

    /**
     * 查询规则列表
     *
     * @param rule 规则
     * @return 规则集合
     */
   /* @DataPermission({
        @DataColumn(key = "tenantName", value = "r.create_by"),
        @DataColumn(key = "deptName", value = "r.dept_id"),
        @DataColumn(key = "userName", value = "r.create_by")
    })*/
    List<RuleVo> selectRuleList(@Param("rule") RuleBo rule);

    RuleVo selectRuleVoByID(String id);
}
